package com.tuanzi.loan.web.lazy.family.push;

import com.tuanzi.loan.business.service.push.LoanPushMessageSendTaskService;
import com.tuanzi.loan.core.lazy.BaseLazyDataModel;
import com.tuanzi.loan.core.util.SpringContextHolder;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.family.push.LoanPushMessageSendTaskRequest;
import com.tuanzi.loan.vo.response.family.push.LoanPushMessageSendTaskResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;

/**
 * @Author: chenweijun
 * @Date: 2018/12/12 14:30
 * @Description:
 */
public class LoanPushMessageSendTaskLazyDataModel extends BaseLazyDataModel<LoanPushMessageSendTaskRequest, LoanPushMessageSendTaskResponse>{

    private LoanPushMessageSendTaskService loanPushMessageSendTaskService = SpringContextHolder.getBean(LoanPushMessageSendTaskService.class);

    public LoanPushMessageSendTaskLazyDataModel(LoanPushMessageSendTaskRequest loanPushMessageSendTaskRequest) {
        super(loanPushMessageSendTaskRequest);
    }

    @Override
    protected Page<LoanPushMessageSendTaskResponse> doLoad(PageSearcher<LoanPushMessageSendTaskRequest> pageSearcher) {
        return loanPushMessageSendTaskService.list(pageSearcher);
    }
}
